﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
using GiaoTrinhEPU.Repositories;

namespace GiaoTrinhEPU.Repositories.DataModels
{
    public class DegreeModel
    {
        [HiddenInput(DisplayValue = false)]
        public int Id { get; set; }

        [Required(ErrorMessage = "Tên hệ không được để trống")]
        [DataType(DataType.Text)]
        [Display(Name = "Tên Hệ")]
        [Remote("IsNameAvaiable", "Degree", AdditionalFields = "Id")]
        public String Name { get; set; }

        [Display(Name = "Mô Tả")]
        [DataType(DataType.MultilineText)]     
        [AllowHtml]
        public String Description { get; set; }

        public DegreeModel () : base() { }
        public DegreeModel(Degree degree)
            : base()
        {
            this.Id = (int)degree.Id;
            this.Name = degree.Name;
            this.Description = degree.Description;
            
        }
    }
}
